<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>班次管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {

	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/schedef/tSchedef/">班次列表</a></li>
		<shiro:hasPermission name="schedef:tSchedef:edit">
			<li><a href="${ctx}/schedef/tSchedef/form">班次添加</a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="TSchedef"
		action="${ctx}/schedef/tSchedef/" method="post"
		class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<ul class="ul-form">
			<li><label>班次名称：</label> <form:input path="schename"
					maxlength="50" class="input-medium" /></li>
			<li><label>班次类型：</label> <form:select path="schetype"
					class="input-medium"
					onchange="typeChange(this.options[this.options.selectedIndex].value)">
					<option value="">--请选择--</option>
					<form:options items="${fns:getDictList('T_Schede_Type')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select></li>
			<li><label>审核状态：</label> <form:select path="auditstatus"
					class="input-medium"
					onchange="typeChange(this.options[this.options.selectedIndex].value)">
					<option value="">--请选择--</option>
					<form:options items="${fns:getDictList('auditstatus')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select></li>

			<li class="btns"><input id="btnSubmit" class="btn btn-primary"
				type="submit" value="查询" /></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>班次名称</th>
				<th>班次类型</th>
				<th>车辆数</th>
				<th>座位数</th>
				<th>预售天数</th>
				<th>审核状态</th>
				<shiro:hasPermission name="schedef:tSchedef:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>

		<tbody>
			<c:forEach items="${page.list}" var="tSchedef">
				<tr>
					<td>${tSchedef.schename}</td>
					<td>${fns:getDictLabel(tSchedef.schetype, 'T_Schede_Type', '无')}</td>
					<td>${tSchedef.vehiclenum}</td>
					<td>${tSchedef.totalseats}</td>
					<td>${tSchedef.preselldate}</td>
					<td>${fns:getDictLabel(tSchedef.auditstatus, 'auditstatus', '无')}</td>
					<shiro:hasPermission name="schedef:tSchedef:edit">
						<td><c:if test="${tSchedef.auditstatus == 3 }">
								<a
									href="${ctx}/schedef/tSchedef/form?id=${tSchedef.scheid}&updateorview=U">修改</a>
							</c:if> <c:if test="${tSchedef.auditstatus != 3}">
								<a
									href="${ctx}/schedef/tSchedef/form?id=${tSchedef.scheid}&updateorview=V">查询</a>
							</c:if> <c:if test="${tSchedef.auditstatus == 9 }">
								<a
									href="${ctx}/schedef/tSchedef/enableSche?id=${tSchedef.scheid}"
									onclick="return confirmx('确认要启用该班次吗？', this.href)">启用</a>
							</c:if> <c:if test="${tSchedef.auditstatus == 1 }">
								<a
									href="${ctx}/schedef/tSchedef/disableSche?id=${tSchedef.scheid}"
									onclick="return confirmx('确认要停用该班次吗？', this.href)">停用</a>
							</c:if> <c:if test="${tSchedef.auditstatus == 2 }">
								<a href="${ctx}/schedef/tSchedef/delete?id=${tSchedef.scheid}"
									onclick="return confirmx('确认要删除该班次吗？', this.href)">删除</a>
							</c:if></td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>